<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>核酸检测案例</title>
  <!--  引入样式-->
  <link rel="stylesheet" href="../lib/bootstrap.css">
  <link rel="stylesheet" href="./brandlist.css">
  <link href="../image/favicon.ico" rel="shortcut icon">
  <!--  引入vue.js-->
  <script src="../lib/vue-2.6.12.js"></script>
</head>

<body>

  <div id="app">
    <!-- 卡片区域 -->
    <div class="card">
      <div class="card-header">
        添加核酸人员
      </div>
      <div class="card-body">
        <!-- 添加核酸人员的表单区域 -->
        <!-- 阻止表单自动提交事件-->
        <form @submit.prevent="add">
          <div class="form-row align-items-center">
            <div class="col-auto">
              <div class="input-group mb-2">
                <div class="input-group-prepend">
                  <div class="input-group-text">人员名称</div>
                </div>
                <label>
                  <input type="text" class="form-control" placeholder="请输入核酸人员名称" v-model.trim="brand">
                </label>
              </div>
            </div>
            <div class="col-auto">
              <button type="submit" class="btn btn-primary mb-2">添加</button>
            </div>
          </div>
        </form>
      </div>
    </div>

    <!-- 表格区域 -->
    <table class="table table-bordered table-hover table-striped">
      <thead>
        <tr>
          <th scope="col">序号</th>
          <th scope="col">名字</th>
          <th scope="col">状态</th>
          <th scope="col">核酸时间</th>
          <th scope="col">操作</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(item,index) in list" :key="item.id">
          <td>{{ index + 1}}</td>
          <td>{{ item.name }}</td>
          <td>
            <div class="custom-control custom-switch">
              <input type="checkbox" class="custom-control-input" :id="'customSwitch'+item.id" v-model="item.status">

              <label class="custom-control-label" :for="'customSwitch'+item.id" v-if="item.status">已做核酸</label>
              <label class="custom-control-label" :for="'customSwitch'+item.id" v-else>未做核酸</label>
            </div>
          </td>
          <td>{{ item.time | dateFormat}}</td>
          <td>
            <a href="javascript:;" @click="remove(item.id)">删除</a>
          </td>
        </tr>
      </tbody>
    </table>
  </div>

  <!--vue.js-->
  <script src="./核酸检测案例.js">
  </script>



</body>

</html>